package com.zw.cloud.mybatis.plus.enums;

import java.util.Objects;

/**
 * 生产类型(0试样，1大货)
 */
public enum ProductTypeEnum {
    LARGE_GOODS(1, "大货"),
    SAMPLE_GOODS(0, "试样");

    private Integer typeCode;
    private String desc;

    ProductTypeEnum(Integer typeCode, String desc) {
        this.typeCode = typeCode;
        this.desc = desc;
    }

    public Integer getTypeCode() {
        return typeCode;
    }

    public String getDesc() {
        return desc;
    }

    public static String queryDesc(Integer typeCode) {
        if (Objects.isNull(typeCode)) {
            return null;
        }
        if (Objects.equals(1,typeCode)) {
            return LARGE_GOODS.desc;
        }
        if (Objects.equals(0,typeCode)) {
            return SAMPLE_GOODS.desc;
        }
        return null;
    }
}
